package com.yjf.crud.service;

import com.simple.multiple.db.config.DS;
import com.yjf.crud.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    @DS
    public List<Map<String,Object>> master() {
        return userMapper.getUsers();
    }

    @DS("db2")
    public List<Map<String,Object>> slave() {
        return userMapper.getUsers();
    }
}
